<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>

<c:url var="logout_url" value="/j_spring_security_logout" />

<p>
	Welcome <sec:authentication property="principal.username" /> <a id="linkLogout" href="${logout_url}">Logout</a>
</p>

<c:url var="user_dashboard_url" value="/user/dashboard" />
<c:url var="admin_dashboard_url" value="/admin/dashboard" />

<c:choose>
	<c:when test="${activeAccount == false }">
		<p>account disabled</p>
	</c:when>
	<c:otherwise>	
		<c:choose>
	       <c:when test="${activeRole == false }">
	            <p>role disabled</p>
	       </c:when>
	       <c:otherwise>
	   
				<ul>
					<sec:authorize access="isAuthenticated()">
						<li><a href="${user_dashboard_url}">User</a></li>
					</sec:authorize>
					<sec:authorize access="hasRole('ROLE_ADMIN')">
						<li><a href="${admin_dashboard_url}">Admin</a></li>
					</sec:authorize>
				</ul>
			</c:otherwise>
		 
        </c:choose>	
	</c:otherwise>
</c:choose>
